import request from '@/utils/request'

// 查询门店表列表
export function listShop(query) {
  return request({
    url: '/system/shop/all',
    method: 'get',
    params: query
  })
}
// 门店组件
export function shopModule(query) {
  return request({
    url: '/system/shop/shopModule',
    method: 'get',
    params: query
  })
}

// cs门店组件
export function csShopModule(query) {
  return request({
    url: '/system/shop/csShopModule',
    method: 'get',
    params: query
  })
}

export function roleModule(query) {
  return request({
    url: '/system/shop/roleModule',
    method: 'get',
    params: query
  })
}


// 查询门店表详细
export function getShop(id) {
  return request({
    url: '/system/shop/' + id,
    method: 'get'
  })
}

export function shopMaintenance(query) {
  return request({
    url: '/system/maintenance/list',
    method: 'get',
    params: query
  })
}

// 新增门店表
export function addShop(data) {
  return request({
    url: '/system/shop',
    method: 'post',
    data: data
  })
}

// 修改门店表
export function updateShop(data) {
  return request({
    url: '/system/shop',
    method: 'put',
    data: data
  })
}

// 修改门店配置
export function updateShopAllocation(data) {
  return request({
    url: '/system/shop/updateShopAllocation',
    method: 'post',
    data: data
  })
}

export function updateShopMaintenance(data) {
  return request({
    url: '/system/shop/updateShopMaintenance',
    method: 'post',
    data: data
  })
}



// 删除门店表
export function delShop(id) {
  return request({
    url: '/system/shop/' + id,
    method: 'delete'
  })
}

// 导出门店表
export function exportShop(query) {
  return request({
    url: '/system/shop/export',
    method: 'get',
    params: query
  })
}

//查询省份或者市区
export function getProvinceAndCity(query) {
  return request({
    url: '/system/shop/getProvinceAndCity',
    method: 'get',
    params: query
  })
}
